import { Component, OnInit } from '@angular/core';
import { ActivatedRouteSnapshot, ActivatedRoute } from '@angular/router';

@Component({
  selector: 'app-product',
  templateUrl: './product.component.html',
  styleUrls: ['./product.component.css']
})
export class ProductComponent implements OnInit {

  //private id: number;
  private prod: Product;
  constructor(private activatedRoute: ActivatedRoute) {
    //this.id = this.activatedRoute.snapshot.queryParams["id"];
    this.prod = this.activatedRoute.snapshot.data["prod"];
    console.log(this.prod);
  }

  ngOnInit() {
  }

}
export class Product {
  constructor(public id: number, public prodTitle: string, public prodImg: string) { }
}
